package com.hbk;

import com.alibaba.fastjson.JSON;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.boot.context.ApplicationPidFileWriter;
import org.springframework.boot.web.context.WebServerPortFileWriter;
import org.springframework.context.ConfigurableApplicationContext;

@SpringBootApplication
public class HbkMain {

    /**
        启动时，指定命令行参数
        -Dapp.home=E:\test\hbk
        在home目录下，有config.json文件，配置各类参数
     */
    public static void main(String... args){
        SpringApplication app = new SpringApplication(HbkMain.class);
        app.addListeners(new ApplicationPidFileWriter("logs/app.pid"));
        app.addListeners(new WebServerPortFileWriter("logs/app.port"));
        ConfigurableApplicationContext context = app.run(args);
        System.out.println("--->> 项目启动成功! <<---");
    }
}
